package com.cheer.ba.view.activity;

import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import android.widget.TextView;

import com.bigkoo.svprogresshud.SVProgressHUD;
import com.cheer.ba.R;
import com.cheer.ba.constant.H5Address;
import com.cheer.ba.utils.TextViewUtils;
import com.cheer.ba.view.base.BaseCommAty;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 申请油卡
 *
 * @author HQ
 *         created at 2017/5/13 0013 14:49
 */
public class AskOilCardAty extends BaseCommAty {

    @BindView(R.id.id_agree_oil_ask_txt)
    TextView mTxtAgreeOilAsk;

    //同意条款
    @BindView(R.id.id_oil_checkbox)
    CheckBox mCheckBox;


    @Override
    public View loadView(LayoutInflater inflater, View childView) {
        return super.loadView(inflater, inflater.inflate(R.layout.aty_ask_oil_card, null, false));
    }

    @Override
    public void initView() {
        setTitleText(getString(R.string.ask_oil_title));
        TextViewUtils.setSpannableStyleColor(getString(R.string.oil_ask_desc),7,15,mTxtAgreeOilAsk,R.color.color_main);
    }

    @OnClick({R.id.id_agree_oil_ask_txt, R.id.id_quick_handle_btn})
    public void onClick(View mView) {
        switch (mView.getId()) {
            //是否同意协议
            case R.id.id_agree_oil_ask_txt:
                CommH5Aty.startCommonH5(aty, H5Address.USER_RECHARGE,false);
                break;
            //立即办理
            case R.id.id_quick_handle_btn:
                if (mCheckBox.isChecked()) {
                    showActivity(aty, HandleOilCardAty.class);
                } else {
                    SVProgressHUD.showInfoWithStatus(aty, "请同意小油石油服务协议");
                }
                break;
        }
    }
}
